export default {
    install(Vue) {
        Vue.directive('debounce', {
            bind(el, binding, vnode) {
                let timeout;
                const delay = 500; // 默认时间500毫秒
                el.addEventListener('click', () => {
                    clearTimeout(timeout);
                    timeout = setTimeout(() => {
                        binding.value();
                    }, delay);
                });
            }
        });
    }
};
